#ifndef _CMINIMONTHVIEW_H_
#define _CMINIMONTHVIEW_H_

#include "auto.h"

#include <buola/datetime/cdatetime.h>
#include <buola/utility/usignal.h>

#include <buola/widgets/cwidget.h>

namespace buola { namespace bcal {

class CMiniMonthView : public gui::CWidget
{
public:
    CMiniMonthView(CCalManager *pManager);
    ~CMiniMonthView();

//Managing fields
    void SetDate(const CDate &pDate);
    void SetToday();

    void Next();
    void Previous();

private:
    void Shape();

public:
////////////// Event handling //////////////
    virtual void OnPreExpose();
    virtual void OnExpose(const gui::CExposeEvent &pE);
    virtual void OnButtonDown(const gui::CMouseEvent &pE);
    virtual void OnButtonUp(const gui::CMouseEvent &pE);
    virtual void OnSize(const gui::CGeometryEvent &pE);

    virtual void OnStyleChanged(TStyle);

protected:
/////////////// protected functions //////////////

public:
    USignal<void(const std::wstring&)> sChangeTitle;

private:
    img::PFont mFont;

    CDate mDate;
    CRect_d mMonthsRect;

    bool mValid;

    //CCalManager *mManager;
};

/*namespace buola*/ } /*namespace bcal*/ }

#endif
